package com.frame.database.operate;

import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.Map;

import org.hibernate.HibernateException;
import org.hibernate.Transaction;

import com.frame.database.JdataBean;
import com.frame.database.PageResult;
import com.frame.database.TableBean;

/**
 * @Title: 系统
 * @Description:
 * @Copyright: Copyright (c) 2012
 * @Company:
 * @author 王海锋
 * @CreatedTime:2012-6-10 上午10:48:13
 * @version 1.0
 */

public interface Jsession {

    public String getFtg();
    public void setFtg(String ftg);
    public void setLoadLob(boolean loadLob);
    public void beginTransaction();
    public void commit() throws SQLException;
    void rollback() throws SQLException;
    public void closeSession();
    public void closeSession(boolean forcibly);
    public void closeStatements();
    public List<JdataBean> query(String sql,Object[] parmObj) throws Exception;
    public List query(String sql,Object[] parmObj,Class dataVoclass) throws Exception;
    public List<JdataBean> query2(String sql,List parmList) throws Exception;
    public List query2(String sql,List parmList,Class dataVoclass) throws Exception;
    public PageResult query(String sql,Object[] parmObj,int size,int pageNo,Class dataVoclass) throws Exception;
    public PageResult query(String sql,Object[] parmObj,int size,int pageNo) throws Exception;
    public PageResult query2(String sql,List parmList,int size,int pageNo,Class dataVoclass) throws Exception;
    public PageResult query2(String sql,List parmList,int size,int pageNo) throws Exception;
    public void save(TableBean bean) throws Exception;
    public void save(String tableName,Map dataMap) throws Exception;
    public String saveReturnKey(String tableName,Map dataMap) throws HibernateException, Exception;
    public void update(TableBean bean) throws Exception;
    public int update(String sql,Object[] obj) throws Exception;
    public int update(String tableName,Map updateMap,Map keyMap) throws Exception;
    public int delete(String sql,Object[] obj) throws HibernateException, Exception;
    public void delete(TableBean bean) throws HibernateException, Exception;
    public TableBean getBean(Class classes, Serializable key) throws Exception;
    public JdataBean getObject(String sql,Object[] obj) throws Exception;
    public JdataBean getObject2(String sql,List parmList) throws Exception;
    public Connection getConnection() throws HibernateException, Exception;
    public PreparedStatement createPreparedStatement(String sql) throws HibernateException, SQLException, Exception;
    public PreparedStatement createPreparedStatement(String sql,int type) throws HibernateException, SQLException, Exception;
    public Statement createStatement() throws HibernateException, SQLException, Exception;
    public Transaction getTransaction() throws Exception;
    List<Map> queryMap(String sql,Object[] parmObj) throws Exception;
}
